package com.ctrip.cap.internal.appium.suite.android;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ctrip.cap.device.android.AndroidDevice;
import com.ctrip.cap.device.android.AndroidDeviceBrand;
import com.ctrip.cap.device.android.KeyEvent;

/**
 * 独立的Device处理
 * 
 * @author ltyao
 *
 */
public interface H5ProcessFilter {

	static final Logger LOGGER = LoggerFactory.getLogger(H5ProcessFilter.class);

	void doFilter(AndroidDevice device);

	public static class OppoBatteryNotifierFilter implements H5ProcessFilter {

		@Override
		public void doFilter(AndroidDevice device) {
			AndroidDeviceBrand brand = device.getBrand();
			if (brand.equals(AndroidDeviceBrand.OPPO_X9007)) {
				LOGGER.debug("OppoBatteryNotifierFilter {}", brand);
				device.unlock();
				device.tap(200, 1400); // 电量已满 ok button
				device.inputKeyevent(KeyEvent.KEYCODE_HOME);
			}
		}

	}

}
